/*
 Date: 2024-05-23 10:39:54
*/

SET FOREIGN_KEY_CHECKS = 0;

TRUNCATE TABLE `user_group`;
BEGIN;
INSERT INTO `user_group` VALUES(1,'用户','','1716432444','1716432444','normal');
INSERT INTO `user_group` VALUES(2,'品鉴官','','1716432444','1716432444','normal');
INSERT INTO `user_group` VALUES(3,'代言人','','1716432444','1716432444','normal');
INSERT INTO `user_group` VALUES(4,'形象代言人','','1716432444','1716432444','normal');
INSERT INTO `user_group` VALUES(5,'区域合伙人','','1716432444','1716432444','normal');
INSERT INTO `user_group` VALUES(6,'城市合伙人','','1716432444','1716432444','normal');
INSERT INTO `user_group` VALUES(7,'省级合伙人','','1716432444','1716432444','normal');
COMMIT;

ALTER TABLE `user_relation`
    ADD `num` int(11) NOT NULL DEFAULT 0 COMMENT '销售量(箱)' AFTER `p_user_id`;

DROP TABLE IF EXISTS `share_earnings`;
CREATE TABLE `share_earnings`
(
    `id`           int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `group_id`     int(10)          NOT NULL COMMENT '分组',
    `name`         varchar(20)      NOT NULL COMMENT '名称',
    `num`          int(10)          NOT NULL COMMENT '任务量(箱)',
#     `introduce`    int(10)          NOT NULL COMMENT '介绍奖',
    `recommend`    int(10)          NOT NULL COMMENT '推荐奖',
#     `repurchase`   int(10)          NOT NULL COMMENT '复购奖',
#     `talent_scout` int(10)          NOT NULL COMMENT '伯乐奖',
#     `differential` int(10)          NOT NULL COMMENT '差价',
    `createtime`   bigint(16) DEFAULT NULL COMMENT '创建时间',
    `updatetime`   bigint(16) DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE utf8mb4_unicode_ci COMMENT ='分享收益表';

BEGIN;
INSERT INTO `share_earnings` VALUES(1,2,'品鉴官',1,498,'1716432444','1716432444');
INSERT INTO `share_earnings` VALUES(2,3,'代言人',8,598,'1716432444','1716432444');
INSERT INTO `share_earnings` VALUES(3,4,'形象代言人',60,698,'1716432444','1716432444');
INSERT INTO `share_earnings` VALUES(4,5,'区域合伙人',240,798,'1716432444','1716432444');
INSERT INTO `share_earnings` VALUES(5,6,'城市合伙人',800,898,'1716432444','1716432444');
INSERT INTO `share_earnings` VALUES(6,7,'省级合伙人',2000,998,'1716432444','1716432444');
COMMIT;

